{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<img src=\"https://raw.githubusercontent.com/Qiskit/qiskit-tutorials/master/images/qiskit-heading.png\" alt=\"Note: In order for images to show up in this jupyter notebook you need to select File => Trusted Notebook\" width=\"500 px\" align=\"left\">"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## _*Comparing Classical and Quantum Finite Automata (QFA)*_\n",
    "\n",
    "Finite Automaton has been a mathematical model for computation since its invention in the 1940s. The purpose of a Finite State Machine is to recognize patterns within an input taken from some character set and accept or reject the input based on whether the pattern defined by the machine occurs in the input. The machine requires a list of states, the initial state, and the conditions for each transition from state to state. Such classical examples are vending machines, coin-operated turnstiles, elevators, traffic lights, etc. \n",
    "\n",
    "In the classical algorithm, the sequence begins in the start state, and will only make a transition if the next character in the input string matches the label on the transition from the current to the next state. The machine will continue making transitions on each input character until no move is possible. The string will be accepted if its final state is in the accept state and will be rejected if its final state is anywhere else. \n",
    "\n",
    "As for Quantum Finite Automata (QFA), the machine works by accepting a finite-length string of letters from a finite alphabet and utilizing quantum properties such as superposition to assign the string a probability of being in either the accept or reject state. \n",
    "\n",
    "***\n",
    "### Contributors\n",
    "Kaitlin Gili, Rudy Raymond\n",
    "\n",
    "### Qiskit Package Versions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'qiskit': '0.10.3',\n",
       " 'qiskit-terra': '0.8.1',\n",
       " 'qiskit-ignis': '0.1.1',\n",
       " 'qiskit-aer': '0.2.1',\n",
       " 'qiskit-ibmq-provider': '0.2.2',\n",
       " 'qiskit-aqua': '0.5.1'}"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import qiskit\n",
    "qiskit.__qiskit_version__"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Prime Divisibility Algorithm \n",
    "\n",
    "Let's say that we have a string with $ a^i $ letters and we want to know whether the string is in the language $ L $ where $ L $ = {$ a^i $ | $ i $ is divisble by $ p $} and $ p $ is a prime number. If $ i $ is divisible by $ p $, we want to accept the string into the language, and if not, we want to reject it. \n",
    "$|0\\rangle $ and $ |1\\rangle $ serve as our accept and reject states. \n",
    "\n",
    "Classically, this algorithm requires a minimum of $ log(p) $ bits to store the information, whereas the quantum algorithm only requires $ log(log(p)) $ qubits. For example, using the highest known prime integer, the classical algorithm requires **a minimum of 77,232,917 bits**, whereas the quantum algorithm **only requires 27 qubits**. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Introduction <a id='introduction'></a>\n",
    "\n",
    "The algorithm in this notebook follows that in [Ambainis et al. 1998](https://arxiv.org/pdf/quant-ph/9802062.pdf). We assume that we are given a string and a prime integer. If the user does not input a prime number, the output will be a ValueError. First, we demonstrate a simpler version of the quantum algorithm that uses $ log(p) $ qubits to store the information. Then, we can use this to more easily understand the quantum algorithm that requires only $ log(log(p)) $ qubits."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The Algorithm for Log(p) Qubits\n",
    "\n",
    "The algorithm is quite simple as follows.\n",
    "1. Prepare quantum and classical registers for $ log(p) $ qubits initialized to zero. \n",
    "$$ |0\\ldots 0\\rangle $$ \n",
    "2. Prepare $ log(p) $ random numbers k in the range {$ 1 $... $ p-1 $}. These numbers will be used to decrease the probability of a string getting accepted when $ i $ does not divide $ p $. \n",
    "3. Perform a number of $ i $ Y-Rotations on each qubit, where $ \\theta $ is initially zero and $ \\Phi $ is the angle of rotation for each unitary. $$ \\Phi = \\frac{2 \\pi k}{p} $$\n",
    "4. In the final state: \n",
    "$$ \\cos \\theta |0\\rangle + \\sin \\theta |1\\rangle $$\n",
    "$$ \\theta = \\frac{2 \\pi k} p {i} $$\n",
    "5. Measure each of the qubits in the classical register. If $ i $ divides $ p $, $ \\cos \\theta $ will be one for every qubit and the state will collapse to $ |0\\rangle $ to demonstrate an accept state with a probability of one. Otherwise, the output will consist of a small probability of accepting the string into the language and a higher probability of rejecting the string."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The Circuit <a id=\"circuit\"></a>\n",
    "\n",
    "We now implement the QFA Prime Divisibility algorithm with QISKit by first preparing the environment."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# useful additional packages \n",
    "import random\n",
    "import math\n",
    "from sympy.ntheory import isprime\n",
    "\n",
    "# importing QISKit\n",
    "from qiskit import QuantumCircuit, ClassicalRegister, QuantumRegister\n",
    "from qiskit import Aer, IBMQ, execute\n",
    "\n",
    "from qiskit.tools.monitor import job_monitor\n",
    "from qiskit.providers.ibmq import least_busy\n",
    "from qiskit.tools.visualization import plot_histogram"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "IBMQ.load_account()\n",
    "sim_backend = Aer.get_backend('qasm_simulator')\n",
    "device_backend = least_busy(IBMQ.backends(operational=True, simulator=False))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We then use QISKit to program the algorithm."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Function that takes in a prime number and a string of letters and returns a quantum circuit\n",
    "def qfa_algorithm(string, prime):\n",
    "    if isprime(prime) == False:\n",
    "        raise ValueError(\"This number is not a prime\") #Raises a ValueError if the input prime number is not prime\n",
    "    else:\n",
    "        n = math.ceil((math.log(prime))) #Rounds up to the next integer of the log(prime)\n",
    "        qr = QuantumRegister(n) #Creates a quantum register of length log(prime) for log(prime) qubits\n",
    "        cr = ClassicalRegister(n) #Creates a classical register for measurement \n",
    "        qfaCircuit = QuantumCircuit(qr, cr) #Defining the circuit to take in the values of qr and cr\n",
    "        for x in range(n): #For each qubit, we want to apply a series of unitary operations with a random int\n",
    "            random_value = random.randint(1,prime - 1) #Generates the random int for each qubit from {1, prime -1}\n",
    "            for letter in string: #For each letter in the string, we want to apply the same unitary operation to each qubit\n",
    "                qfaCircuit.ry((2*math.pi*random_value) / prime, qr[x]) #Applies the Y-Rotation to each qubit \n",
    "            qfaCircuit.measure(qr[x], cr[x]) #Measures each qubit \n",
    "        return qfaCircuit #Returns the created quantum circuit"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The qfa_algorithm function returns the Quantum Circuit qfaCircuit."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Experiment with Simulators\n",
    "\n",
    "We can run the above circuit on the simulator. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "#A function that returns a string saying if the string is accepted into the language or rejected\n",
    "def accept(parameter):\n",
    "    states = list(result.get_counts(parameter))\n",
    "    for s in states:\n",
    "        for integer in s:\n",
    "            if integer == \"1\":\n",
    "                return \"Reject: the string is not accepted into the language\"\n",
    "    return \"Accept: the string is accepted into the language\""
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Insert your own parameters and try even larger prime numbers."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [],
   "source": [
    "range_lower = 0\n",
    "range_higher = 36\n",
    "prime_number = 11"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accept: the string is accepted into the language \n",
      " Length: 0   {'000': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 1   {'011': 58, '100': 166, '101': 192, '000': 38, '111': 264, '010': 44, '001': 41, '110': 197}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 2   {'011': 85, '100': 163, '101': 240, '000': 128, '111': 99, '010': 51, '001': 158, '110': 76}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 3   {'011': 1, '100': 853, '101': 58, '000': 12, '111': 6, '010': 3, '001': 1, '110': 66}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 4   {'011': 118, '100': 27, '101': 125, '000': 6, '111': 559, '010': 22, '001': 22, '110': 121}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 5   {'011': 59, '100': 14, '101': 66, '000': 137, '111': 10, '010': 17, '001': 693, '110': 4}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 6   {'011': 7, '111': 289, '100': 11, '101': 671, '001': 15, '110': 7}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 7   {'011': 34, '100': 267, '101': 126, '000': 221, '111': 41, '010': 88, '001': 96, '110': 127}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 8   {'011': 26, '100': 260, '101': 343, '000': 46, '111': 144, '010': 25, '001': 70, '110': 86}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 9   {'011': 193, '000': 7, '111': 90, '100': 6, '010': 4, '101': 212, '001': 488}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 10   {'011': 63, '000': 19, '111': 24, '100': 6, '010': 2, '101': 256, '001': 630}\n",
      "Accept: the string is accepted into the language \n",
      " Length: 11   {'000': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 12   {'011': 223, '100': 54, '101': 79, '000': 117, '111': 94, '010': 179, '001': 180, '110': 74}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 13   {'011': 19, '111': 658, '100': 29, '010': 2, '101': 143, '001': 2, '110': 147}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 14   {'011': 21, '100': 228, '101': 322, '000': 144, '111': 22, '010': 19, '001': 223, '110': 21}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 15   {'011': 209, '100': 51, '101': 51, '000': 24, '111': 250, '010': 149, '001': 50, '110': 216}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 16   {'011': 14, '100': 16, '101': 2, '000': 3, '111': 68, '010': 161, '001': 1, '110': 735}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 17   {'011': 384, '100': 3, '101': 124, '000': 3, '111': 155, '010': 9, '001': 319, '110': 3}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 18   {'011': 200, '100': 41, '101': 65, '000': 27, '111': 270, '010': 143, '001': 41, '110': 213}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 19   {'011': 35, '100': 27, '101': 37, '000': 370, '111': 1, '010': 34, '001': 495, '110': 1}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 20   {'011': 5, '100': 323, '101': 426, '000': 67, '111': 34, '010': 6, '001': 113, '110': 26}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 21   {'011': 156, '100': 24, '101': 34, '000': 274, '111': 8, '010': 117, '001': 377, '110': 10}\n",
      "Accept: the string is accepted into the language \n",
      " Length: 22   {'000': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 23   {'011': 57, '000': 16, '111': 26, '100': 3, '010': 1, '101': 239, '001': 658}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 24   {'011': 641, '100': 3, '101': 11, '000': 29, '111': 52, '010': 135, '001': 119, '110': 10}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 25   {'000': 5, '111': 65, '100': 141, '010': 14, '101': 14, '110': 761}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 26   {'011': 174, '111': 788, '010': 6, '101': 15, '001': 2, '110': 15}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 27   {'011': 5, '100': 138, '101': 43, '000': 4, '111': 233, '010': 12, '001': 1, '110': 564}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 28   {'011': 23, '100': 103, '101': 436, '000': 70, '111': 34, '010': 11, '001': 315, '110': 8}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 29   {'011': 202, '100': 13, '101': 51, '000': 115, '111': 14, '010': 56, '001': 544, '110': 5}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 30   {'011': 155, '111': 644, '100': 2, '010': 3, '101': 146, '001': 38, '110': 12}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 31   {'011': 38, '100': 9, '101': 1, '000': 4, '111': 43, '010': 403, '001': 1, '110': 501}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 32   {'011': 203, '100': 7, '101': 3, '000': 11, '111': 100, '010': 475, '001': 3, '110': 198}\n",
      "Accept: the string is accepted into the language \n",
      " Length: 33   {'000': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 34   {'011': 411, '100': 3, '101': 6, '000': 4, '111': 178, '010': 263, '001': 5, '110': 130}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 35   {'011': 684, '111': 280, '010': 12, '101': 7, '001': 9, '110': 8}\n"
     ]
    }
   ],
   "source": [
    "for length in range(range_lower,range_higher):\n",
    "    params = qfa_algorithm(\"a\"* length, prime_number)\n",
    "    job = execute(params, sim_backend, shots=1000)\n",
    "    result = job.result()\n",
    "    print(accept(params), \"\\n\", \"Length:\",length,\" \" ,result.get_counts(params))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Drawing the circuit of the QFA\n",
    "\n",
    "Below is the snapshop of the QFA for reading the bitstring of length $3$. It can be seen that there are independent QFAs each of which performs $Y$ rotation for $3$ times.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAi8AAAEsCAYAAAALqFN3AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3df1hUdaI/8PeANqjDzADjb0SENskU+RGpyMaEG5hx0wLLbM1yTV3cNp/EC0rdJUoDtRLLW5fNsFS8ZXZDr6gtrXTVNsAMfdTNriE/RkiCZRykDR043z+8nq8Tv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ZERUXh559/RnBwMA4cOGDzCaVFixYhNjYWM2fO7DDLunXrsHPnTpw5c8au7MnJyaivr0dYWBiamppw//33Y8eOHT14NLqGh42IiIhstXdUQqgvZvzDH/6A4cOH48UXX1Q6ChERESlEmPJSUFCA6Oho+RCSp6cnPvnkE4VTERERkbMJU16IiIiIAH4xIxEREQmG5YWIiIiEwvJCREREQmF5ISIiIqGwvBAREZFQWF6IiIhIKCwvREREJBSWFyIiIhIKywsREREJheWFiIiIhMLyQkREREJheSEiIiKhsLwQERGRUFheiIiISCgsL0RERCQUlhciIiISCssLERERCYXlhYiIiITC8kJERERCYXkhIiIiobC8EBERkVBYXoiIiEgoLC9EREQkFJYXIiIiEsr/A33EIFNvvLy0AAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 722.4x379.26 with 1 Axes>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qfa_algorithm(\"a\"* 3, prime_number).draw(output='mpl')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The Algorithm for Log(Log(p)) Qubits\n",
    "\n",
    "The algorithm is quite simple as follows.\n",
    "1. Prepare a quantum register for $ log(log(p)) + 1 $ qubits initialized to zero. The $ log(log(p))$ qubits will act as your control bits and the 1 extra will act as your target bit. Also prepare a classical register for 1 bit to measure the target. \n",
    "$$ |0\\ldots 0\\rangle |0\\rangle  $$ \n",
    "2. Hadamard the control bits to put them in a superposition so that we can perform multiple QFA's at the same time.\n",
    "3. For each of $s $ states in the superposition, we can perform an individual QFA with the control qubits acting as the random integer $ k $ from the previous algorithm. Thus, we need $ n $ values from $ 1... log(p)$ for $ k $. For each letter $ i $ in the string, we perform a controlled y-rotation on the target qubit, where $ \\theta $ is initially zero and $ \\Phi $ is the angle of rotation for each unitary. $$ \\Phi = \\frac{2 \\pi k_{s}}{p} $$\n",
    "4. The target qubit in the final state: \n",
    "$$ \\cos \\theta |0\\rangle + \\sin \\theta |1\\rangle $$\n",
    "$$ \\theta = \\sum_{s=0}^n \\frac{2 \\pi k_{s}} p {i} $$\n",
    "5. Measure the target qubit in the classical register. If $ i $ divides $ p $, $ \\cos \\theta $ will be one for every QFA and the state of the target will collapse to $ |0\\rangle $ to demonstrate an accept state with a probability of one. Otherwise, the output will consist of a small probability of accepting the string into the language and a higher probability of rejecting the string."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## The Circuit <a id=\"circuit\"></a>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We then use QISKit to program the algorithm."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [],
   "source": [
    "#Function that takes in a prime number and a string of letters and returns a quantum circuit\n",
    "def qfa_controlled_algorithm(string, prime):\n",
    "    if isprime(prime) == False:\n",
    "        raise ValueError(\"This number is not a prime\") #Raises a ValueError if the input prime number is not prime\n",
    "    else:\n",
    "        n = math.ceil((math.log(math.log(prime,2),2))) #Represents log(log(p)) control qubits \n",
    "        states = 2 ** (n) #Number of states that the qubits can represent/Number of QFA's to be performed \n",
    "        qr = QuantumRegister(n+1) #Creates a quantum register of log(log(prime)) control qubits + 1 target qubit\n",
    "        cr = ClassicalRegister(1) #Creates a classical register of log(log(prime)) control qubits + 1 target qubit\n",
    "        control_qfaCircuit = QuantumCircuit(qr, cr) #Defining the circuit to take in the values of qr and cr\n",
    "        for q in range(n): #We want to take each control qubit and put them in a superposition by applying a Hadamard Gate\n",
    "            control_qfaCircuit.h(qr[q])\n",
    "        for letter in string: #For each letter in the string, we want to apply a series of Controlled Y-rotations\n",
    "            for q in range(n):  \n",
    "                control_qfaCircuit.cu3(2*math.pi*(2**q)/prime, 0, 0, qr[q], qr[n]) #Controlled Y on Target qubit \n",
    "        control_qfaCircuit.measure(qr[n], cr[0]) #Measure the target qubit  \n",
    "        return control_qfaCircuit #Returns the created quantum circuit  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The qfa_algorithm function returns the Quantum Circuit control_qfaCircuit."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Experiment with Simulators\n",
    "\n",
    "We can run the above circuit on the simulator. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Accept: the string is accepted into the language \n",
      " Length: 0   {'0': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 1   {'0': 770, '1': 230}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 2   {'0': 464, '1': 536}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 3   {'0': 542, '1': 458}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 4   {'0': 590, '1': 410}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 5   {'0': 542, '1': 458}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 6   {'0': 530, '1': 470}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 7   {'0': 602, '1': 398}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 8   {'0': 556, '1': 444}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 9   {'0': 492, '1': 508}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 10   {'0': 752, '1': 248}\n",
      "Accept: the string is accepted into the language \n",
      " Length: 11   {'0': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 12   {'0': 762, '1': 238}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 13   {'0': 450, '1': 550}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 14   {'0': 524, '1': 476}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 15   {'0': 637, '1': 363}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 16   {'0': 505, '1': 495}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 17   {'0': 520, '1': 480}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 18   {'0': 621, '1': 379}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 19   {'0': 540, '1': 460}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 20   {'0': 484, '1': 516}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 21   {'0': 773, '1': 227}\n",
      "Accept: the string is accepted into the language \n",
      " Length: 22   {'0': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 23   {'0': 773, '1': 227}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 24   {'0': 516, '1': 484}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 25   {'0': 529, '1': 471}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 26   {'0': 599, '1': 401}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 27   {'0': 518, '1': 482}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 28   {'0': 559, '1': 441}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 29   {'0': 620, '1': 380}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 30   {'0': 537, '1': 463}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 31   {'0': 464, '1': 536}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 32   {'0': 766, '1': 234}\n",
      "Accept: the string is accepted into the language \n",
      " Length: 33   {'0': 1000}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 34   {'0': 779, '1': 221}\n",
      "Reject: the string is not accepted into the language \n",
      " Length: 35   {'0': 481, '1': 519}\n"
     ]
    }
   ],
   "source": [
    "for length in range(range_lower,range_higher):\n",
    "    params = qfa_controlled_algorithm(\"a\"* length, prime_number)\n",
    "    job = execute(params, sim_backend, shots=1000)\n",
    "    result = job.result()\n",
    "    print(accept(params), \"\\n\", \"Length:\",length,\" \" ,result.get_counts(params))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Drawing the circuit of the QFA\n",
    "\n",
    "Below is the snapshot of the QFA for reading the bitstring of length $3$. It can be seen that there is a superposition of QFAs instead of independent QFAs. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAA0AAAADRCAYAAADlsdI5AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3dfVhVdb7//9cGNVRutveON4TYlMc7ECIULUhNpsIsbyaPHj3W5E03zjhaB4o5Z5wmDe3mZFdTwTRJjXHm1NHSKQ+Wps5USCRhk51xxBsIRUkTNpKIwPr+4c/9a8f9ZrM2sJ6P61rX5f6sD2u913t/3PDea63PshmGYQgAAAAALMDH2wEAAAAAgFkogAAAAABYBgUQAAAAAMugAAIAAABgGRRAAAAAACyDAggAAACAZVAAAQAAALAMCiAAAAAAlkEBBAAAAMAyKIAAAAAAWAYFEAAAAADLoAACAAAAYBkUQAAAAAAsgwIIAAAAgGVQAAEAAACwDAogAAAAAJZBAQQAAADAMiiAAAAAAFgGBRAAAAAAy6AAAgAAAGAZFEAAAAAALIMCCAAAAIBlUAABAAAAsAwKIAAAAACWQQEEAAAAwDIogAAAAABYRhdvBwDvWrFihfLy8kzfb3h4uJ577jnT9wsAAABr4wyQxeXl5ZleAHljnwAAAIDEGSDo8tmYPXv2mLa/uLg40/YFAAAAfB9ngAAAAABYBgUQAAAAAMugAAIAAABgGRRAAAAAACyDAggAAACAZVAAAQAAALAMCiAAAAAAlmGZ5wClp6crPT29Rc+7iYyM1Nq1axUfH992gaHDq66u1v/+7//q8OHD6tmzp26//XYNGTLE22EBrXL+/Hlt27ZNp06dUp8+fXTnnXcqKCjI22EBrXL69Glt27ZN5eXlCgkJUUJCgrp16+btsACYrE3PAI0aNUr+/v7OpXv37rLZbMrNzZUkJScna9iwYQoMDFT//v01e/ZsFRYWt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/iRpODgYD355JPav3+/unXrpmeeeUbh4eEUP/+fVhdAb775pq655hr5+/tr2rRpWrVqlebMmVOnX3V1tV599VUtXbrU2TZixAgFBQVJkgzDkI+Pjw4dOtTakJotLS1NiYmJCg0NVVBQkNavX6/MzEznWauwsDD5+vpq//79psWE9u2f/umfFBQUpJSUFJWWlurbb7/Vyy+/rBdffFEpKSnOfseOHdOkSZMUHx+vu+66y4sRd1zk2jzk2jzk2jzk2jzkum3V1NRozpw5+uabb7Rz5856/85uSE5Ojk6ePKmAgAAdPnzYeTmc1bWqAHrttde0atUqvfHGGyovL1dCQoI2bNigcePG1en7zjvvqKysTAsXLnRpz8jIUFBQkPz9/bVhwwatXr3arVhSUlJa9G1CaWmpCgsLXU7XDh8+XIGBgTpw4ICzbcaMGdq6datbMaHzCQwM1LvvvqvPPvtMQ4YM0YgRI7RlyxZlZmYqNjbW2W/YsGH66KOPlJ2drYceesiLEXdc5No85No85No85No85LptPf/888rKytJLL72kG264odk/d+Wen6lTpyo7O1uGYWjx4sXNmimus3P7HqDvvvtOK1eu1KZNmxQdHS1Juu+++/SLX/yi3gIoNTVVd999d53To/PmzdO8efN06tQp/eEPf3DOH3/kyBHdc889MgxDhmHoueee0/XXX99gPElJSUpKSmp2/OXl5ZLkPAN1hd1ul8PhcL6+/fbb9eijj+rxxx9v9rbRuU2aNEkff/xxg+svXryoq666StLlXwr+/v5mhdbpkGvzkGvzkGvzkGvzkOu2cfHiRa1du1bTpk3T/Pnzm/1z3y9+rlz29tvf/lYrV65Udna2xo8f34ZRt39uF0B79+5VbW2tbr31VmfbldNqPyyAjhw5ol27dikrK6vB7Q0cOFCLFy9WaGioCgsLZbfb9fbbb6tPnz766quvtHTpUv31r391N9w6AgICJEllZWUu7aWlpQoMDHS+LigoMGVShoau4cRl3/8Gqb3LycnRY489Jl9fX126dEkbNmzwdkgu9u7d2+h4I9eeQ67NQ67NQ67NQ67N01SuzfLD93Tz5s06c+aMHn744WbHV1/xI0mLFy/Wr3/9a7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ORjX7UPPnj3Vo0ePJvs9+uij2r59e5MPOe3WrZsCAgKadUldp2Z4yMcff2wEBAQYtbW1ntqkR33++efGxo0bvR0G3BAbG2vExsa22fb3799v3HfffYZhGMayZcuMTz/91GX9v/7rvxqHDx+u92dzc3ON+fPnN7jt5cuXGx999JFRXl7e6DHceeedRo/Nl0oAAAqRSURBVGFhoVFUVGTccccdLT+IZmoql22d6wsXLhjffvutERsba1y6dKnO+lOnThkffvihkZyc7NL+/PPPG1OnTjU++OCDBrcdFxdnOBwOY9++fcYDDzxQb5+qqipj0qRJxqVLl4w//elPxvr161t3QI3wdq4Z181f31qM6+avby3GdfPXtxbj2nzeiqO9HL+ZPFb+xcTEyOFwtNsp9MLDw7Vo0SJvh4F2aN++fbrlllskSVOnTq0zXbvNZtPChQs1ffp0FRQUuKx7++23Gz07+be//U0xMTHy9/dXQEBAg99gnTt3TkOHDtXgwYNVWlrayiNqv/z8/Br9BnbAgAF1PkOqqqq0b98+TZw4scGf++6779S9e3cFBAQoOjpaBw8erLff4cOHNWbMGHXp0qXe97ozYVybh3FtHsa1eRjX6Mwsfv4LcH32U1BQUJ1faM8884w++eQTJSYmatWqVS7rMjMzG52go6amxvkLor5tX1FbW+v8t8GU6C7S09P1L//yL432+eHzu2pqaprs19j70Rkwrts3xrV7GNftG+MaHQUFECwvKCjI+U2fw+GQ3W53Wd+7d29Jl59hcOrUKWf74cOHNXjw4Eavzf3+Nbb1bfuK73+LZvnrcr+nurpaO3bscHngcn2+/x5KavC5YU29150J47r9Yly7j3HdfjGu0ZHwPxeWN2HCBO3atUuStHPnzjpPR77yAXzo0CGXD+C3335bd911l/N1eXl5nUsmxo4dq6ysLFVUVMjhcCgwMFDffvutLly44NKvd+/eKioq0smTJ12+GbO606dPq7CwUD/5yU+0adMmPfroozp37pxKSkp06dIlZ7+ePXvqwoULOn/+vD799FONHDlSUt1pPq+99lp9+eWXqqmpqfe97kwY1+0X49p9jOv2i3GNDsXL9yABTTLj5ryf//znxqRJk4y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fuWlpaqT58+Dcaydu1avfHGGzp48GCzYk9KStK5c+cUFRWlixcv6pZbbtGmTeadRuQSOAAAAMAzGru6ymYYhmFiLG4rLS3V5MmTlZWVpYqKCk2ePNlj9wABAAAAsIYO84hYu92uFStWKC4uTpL0zDPPUPwAAAAAaJEOcwYIAAAAAFqLUygAAAAALIMCCAAAAIBlUAABAAAAsAwKIAAAAACWQQEEAAAAwDIogAAAAABYBgUQAAAAAMugAAIAAABgGRRAAAAAACyDAggAAACAZVAAAQAAALAMCiAAAAAAlkEBBAAAAMAyKIAAAAAAWAYFEAAAAADLoAACAAAAYBkUQAAAAAAsgwIIAAAAgGVQAAEAAACwDAogAAAAAJZBAQQAAADAMiiAAAAAAFgGBRAAAAAAy6AAAgAAAGAZ/w+UX+QJLlX+uQAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 1083.6x258.86 with 1 Axes>"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qfa_controlled_algorithm(\"a\"* 3, prime_number).draw(output='mpl')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "collapsed": true
   },
   "source": [
    "## Experimenting with Real Devices\n",
    "\n",
    "Real-device backends have errors and if the above QFAs are executed on the noisy backends, errors in rejecting strings that should have been accepted can happen. Let us see how well the real-device backends can realize the QFAs. "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Let us look an example when the QFA should reject the bitstring because the length of the bitstring is not divisible by the prime number."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The length of a is 2  while the prime number is 3\n"
     ]
    }
   ],
   "source": [
    "prime_number = 3\n",
    "length = 2          # set the length so that it is not divisible by the prime_number\n",
    "print(\"The length of a is\", length, \" while the prime number is\", prime_number)\n",
    "qfa1 = qfa_controlled_algorithm(\"a\"* length, prime_number)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Job Status: job has successfully run\n"
     ]
    }
   ],
   "source": [
    "job = execute(qfa1, backend=device_backend, shots=100)\n",
    "job_monitor(job)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAEyCAYAAACYgYvRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAfzUlEQVR4nO3dfZiddX3n8feXPJGEJGTCNEzAJMRkx8mDYQw+VnlYHlbtUgVZ0QsLVJEVLVhZl9qVIrI1VaqWlMUVqC2g0oKiFsGsCLFFAcGGME3IMA0kmTRkCEMSQyAhD+N3/zgn6TCZmdwnnMxMJu/XdZ1rzvndv/uX78m5znzmfvrdkZlIkqR9O6y/C5Ak6WBhaEqSVJChKUlSQYamJEkFGZqSJBVkaEqSVNDQ/i6gP02YMCEnT57c32VIkgaQJ5544oXMrO1u2SEdmpMnT2bRokX9XYYkaQCpqalp7WmZu2clSSrI0JQkqSBDU5KkggxNSZIKMjQlSSrI0JQkqSBDU5KkggxNSZIKMjQlSSrI0JQkqSBDU5KkggxNSZIKMjQlSSrI0JQkqSBDU5KkggxNSZIKMjQlSSrI0JQkqSBDU5KkggxNSZIKMjQlSSrI0JQkqSBDU5IOEvfffz9vectbmDdvHtddd91ey2+//XZmzJjBiSeeyIknnshtt922Z9natWs5++yzeetb38rb3vY21qxZA0BrayunnXYa8+bN46Mf/Sg7duzos/dzMOrz0IyIT0bEqoh4JSIWR8S79tF/eERcU15ne0SsiYjLuvT5QEQsLy9fHhFnHdh3IUl9q6OjgyuuuII777yTRx55hLvuuounnnpqr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RMzpx1IPam5pai/lL9Y9wCjgfOCZzPxtlz6XAh/LzOP7oURJXUTEzZRuYHEtcDZwAfB6oAX4CfAAUA8syMzh/VXnwc4tTe0lM7cBnwdGArcB50fE6yLiCICIGAWcRGnKQkn9LCKGUto79JvMXJmZX83MOcCbgX+mFKB3AtcD3+6/Sg9+bmmqRxExG/gz4PeBlynddaYdOI3SmbQXZebS/qtQ0m4RMR6YmJlPRcRwYGfnE4Ii4lzg74E3eS7C/jM0tU/ly09+D3g/8AqlLczvZeZT/VqYpF5FxGGUfs93RMTHKe2aHdXfdR3MDE1VJCIO63p8U9LAFxGXA0My8y/7u5aDmaEpSYeAiBgGdPhH72tjaEqSVJBnz0qSVJChKUlSQYamJEkFGZqSJBVkaEqSVJChKUlSQf8fz+rtqRnmPmoAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<Figure size 504x360 with 1 Axes>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result = job.result()\n",
    "plot_histogram(result.get_counts())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "In the above, we can see that the probability of observing \"1\" is quite significant. Let us see how the circuit looks like. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAdQAAACkCAYAAAAuct8ZAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAacElEQVR4nO3de1BU5/0/8PeyMQI/dlkiRn4GjYV8TYsGFihBCHXRaIgTDRqjJlqtUosmox2jdcCamdo22tXiGKYtE6gXnCLTrzO1YoxVEkeZoIggApFxarjIRUm5yLKAIoF9fn/k59YNtwUe9oLv18yZgWefc87nPFzee66rEEIIEBER0Yi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BSkREJAEDlYiISAIGKhERkQQMVCIiIgkYqERERBL8P7AyiFb/TeINAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 602x198.66 with 1 Axes>"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qfa1.draw(output='mpl')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Now, let us see what happens when the QFAs should accept the input string."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "scrolled": false
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "The length of a is 3  while the prime number is 3\n"
     ]
    }
   ],
   "source": [
    "print_number = length = 3 # set the length so that it is divisible by the prime_number\n",
    "print(\"The length of a is\", length, \" while the prime number is\", prime_number)\n",
    "qfa2 = qfa_controlled_algorithm(\"a\"* length, prime_number)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Job Status: job has successfully run\n"
     ]
    }
   ],
   "source": [
    "job = execute(qfa2, backend=device_backend, shots=100)\n",
    "job_monitor(job)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAc0AAAEyCAYAAACYgYvRAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAgAElEQVR4nO3df5jWdZ3v8edbfgXGryEWZ3QBEZeGH9GIeTRS+yGFdLYt9aRdtfbLPGmrW9a61Vppu7FnLTtYJ7OszbDdVUtbt5LiGJ4spDUBWdBxFhgZFhgJgUUSZHB6nz/uG3YcZ4bvDcPMAM/Hdd3X3Pfn+/l+5v295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HPvIRZs6cydlnn82vfvWr/es89thjzJw5kxkzZvDJT36SSq5zORZVfE4zM3dn5t9n5p9l5pWZ+a3M3H04ipMklbS2tnLttddy9913s2TJEu655579objPhRdeyOLFi3nooYe4+uqrue666wCYP38+AIsXL+bee+/lM5/5DL///e8B+MQnPsG8efN49NFHWbt2LQ888ADq3AEPz0bEBcCPMnNv+X2nMvPebqtMkrTf0qVLOfnkkxk/fjwAF1xwAQsWLOCVr3zl/j7Dhg3b/37Xrl3su7e9oaGBc845ByjdijF8+HCWL1/OiSeeyM6dO3nNa14DwCWXXML999/PrFntr9fUPkXOaf6A0vnC35bfdyYpTV4gSepmzc3NnHjiifs/19TUsHTp0pf0+9a3vsUtt9xCS0sL9913HwBTpkxhwYIFXHjhhWzcuJHHHnuMjRs3ctxxx1FTU/OiMffdw6mOHfDwbGYel5m/bfO+s5eBKUm97LLLLmPZsmVcf/313HTTTQC85z3voaamhje+8Y18+tOf5owzzqBfP//JPhiVTqN3DvBwZr7Qrr0fMLPtRT2SpO5TXV3Nxo0b93/etGkT1dXVnfa/4IIL+PjHPw5A//79mTt37v5lb3nLWzjllFMYMWLE/hmGioypyi8EehDoaGL2EeVlkqTD4LTTTqOxsZGmpiZaWlq49957mT179ov6rF27dv/7hQsXcsoppwCl85v7psF78MEH6d+/P6985Ss54YQTGDp0KL/5zW/ITO68807mzJnTcxt1BKr0Ps2gdO6yvVHAc4dejiSpI/379+fGG2/koosuorW1lXe/+93U1tYyd+5c6urqOP/887ntttv4xS9+wYABAxgxYgRf+9rXAHjmmWe46KKLiAhqamq49dZb94/7xS9+kY985CM8//zznHfeeZx3XofPz1BZoblnI+Jfym/fSukpJ3vaLO4HTKU09+zs9uv2Zc49q64496x0bOpq7tmie5pbyz8D2A60vS+zBfgVcFv7lSRJOpoUCs3MfD9ARKwDvpSZHoqVJB1zKjqnmZk3HK5CJEnq64rMCPRvwLmZuT0iVtLxhUAAZOarurM4SZL6kiJ7mvfwXxf+dDUjkCRJR7UDhmbbQ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ER+idGh2SG/XdSQzNFWRiDiu/flNSX1fRFwD9MvML/Z2LUcyQ1OSjgERMQBo9T+9h8bQlCSpIK+elSSpIENTkqSCDE1JkgoyNCVJKsjQlCSpIENTkqSC/j+6EMlEVGEdvAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 504x360 with 1 Axes>"
      ]
     },
     "execution_count": 18,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "result = job.result()\n",
    "plot_histogram(result.get_counts())"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The error of rejecting the bitstring is equal to the probability of observing \"1\" which can be checked from the above histogram. We can see that the noise of real-device backends prevents us to have a correct answer. It is left as future work on how to mitigate errors of the backends in the QFA models. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAi8AAACkCAYAAABfPM52AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjAsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+17YcXAAAcBklEQVR4nO3de1BU5/0G8Ge5KCiXRQH9GTQKiWkhkUVCuMS6aBNJEy5eYrXaKEm9xZGplTJg/KO2sYpWO2GacYQ6ihOk1qkXqFF00hEmeEEUF5XEqSgKGAyCuy4QEYH394d1x81yWZblLGd5PjNnRt7znnO++xXw8ZyzZxVCCAEiIiIimXCwdQFEREREfcHwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLC8EJERESywvBCREREssLwQkRERLLiZOsCyLbWrl0LjUYj+XFVKhU+++wzyY9LRETyxzMv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N2/G/v37UVFRYVbtaWlp0Gq1CAsLw+PHj/H2228jJyfHzFfef7xsREREZKy7qxKy+WBGnU6HmTNn4ty5c2hpacHMmTOtds8LERERyYdsbmlWKpVYu3YtoqOjAQA7duxgcCEiIhqCZHPmhYiIiAjgBzMSERGRzDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGsMLwQERGRrDC8EBERkawwvBAREZGs/D83NJc6rjUHiAAAAABJRU5ErkJggg==\n",
      "text/plain": [
       "<Figure size 722.4x198.66 with 1 Axes>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "qfa2.draw(output='mpl')"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.2"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
